/*
 * common_includes.h
 *
 *  Created on: Feb 2, 2012
 *      Author: kkb110
 */

#ifndef COMMON_INCLUDES_H_
#define COMMON_INCLUDES_H_

#include <utility>
#include <string>
#include <numeric>

#include <tuple>
#include <thread>
#include <future>
#include <mutex>
#include <deque>
#include <chrono>
#include <iostream>
#include <fstream>
#include <map>
#include <memory>
#include <vector>
#include <list>
#include <functional>
#include <cmath>
#include <array>
#include <algorithm>

#include <eigen3/Eigen/Core>
#include <eigen3/Eigen/LU>
#include <eigen3/Eigen/Cholesky>
#include <eigen3/Eigen/Eigen>

#include <lbfgs.h>

#include <number.h>

using namespace std;

#ifndef M_PI
#define M_PI		3.14159265358979323846	/* pi */
#endif

//#define NUM_VARIABLES 10

typedef int Shooter;

template<typename T>
void save_eigen(T array, string file_name){
	ofstream file;
	file.open(file_name);
	for (size_t i = 0; i < array.rows(); ++i){
		for (size_t j = 0; j < array.cols(); ++j){
			file << (double) array(i, j) << " ";
		}
		file << endl;
	}
	file.close();
}

template<typename T>
void save_eigens(vector<T> array, string file_name){
	ofstream file;

	file.open(file_name);
	for (size_t i = 0; i < array.size(); ++i){
		for (size_t j = 0; j < array[i].size(); ++j){
			file << (double) array[i](j) << " ";
		}
		file << endl;
	}
	file.close();
}
#endif /* COMMON_INCLUDES_H_ */
